import { $demoi18n } from '@/utils/lang';
export default {

  /* -------- 原型属性 (暂时用于做格式参考) ------- */
  text: {
    type: 'text',
    min: 0,
    max: 80,
    default: '',
  },
  url: {
    type: 'url',
    default: '',
  },
  number: {
    type: 'number',
    step: 1,
    min: -100000000,
    max: 100000000,
    default: 0,
    units: ['px', '%'], // 需要设置单位时加上
    dfUnit: 'px', // 需要设置单位时加上
    switch: false, // 需要显示开关是加上
  },
  boolean: {
    type: 'boolean',
    default: false,
  },
  enum: {
    type: 'enum',
    options: [{ label: 'label1', value: 'value1' }, { label: 'label2', value: 'value2' }],
    default: 'value1',
  },
  color: {
    type: 'color',
    default: '#fff',
  },
  vector: {
    type: 'vector',
    min: 0,
    dims: 'T,R,B,L',
    default: [0, 0, 0, 0],
  },
  angle: {
    type: 'angle',
    min: -180,
    max: 180,
    step: 1,
    default: 0,
  },
  radio: {
    type: 'radio',
    options: [{ label: 'label1', value: 'value1' }, { label: 'label2', value: 'value2' }],
    default: 'value1',
  },
  date: {
    type: 'date',
    timeType: 'date', // date, month, year, week
    default: '2020-10-1',
  },

  /* -------- 常用属性 ------- */
  componentStyle: {
    label: $demoi18n('panel.label.componentStyle'),
    type: 'enum',
    options: [
      { label: $demoi18n('panel.radio.light'), value: 'light' },
      { label: $demoi18n('panel.radio.dark'), value: 'dark' },
      { label: $demoi18n('componentStyle.real'), value: 'real' },
    ],
    default: 'light',
  },
  title: {
    label: $demoi18n('word.title'),
    type: 'text',
  },
  opacity: {
    label: $demoi18n('panel.label.opacityPercent_1'),
    type: 'number',
    min: 0,
    max: 1,
    step: 0.01,
  },
  padding: {
    label: $demoi18n('word.margin'),
    type: 'vector',
    min: 0,
    step: 1,
    dims: 'L|Left,R|Right,T|Top,B|Bottom',
    default: [0, 0, 0, 0],
  },
  margin: {
    label: $demoi18n('word.outerMargin'),
    type: 'vector',
    min: 0,
    step: 1,
    dims: 'L|Left,R|Right,T|Top,B|Bottom',
    default: [0, 0, 0, 0],
  },
  fontSize: {
    label: $demoi18n('word.fontSize'),
    type: 'number',
    default: 14,
    min: 12,
    max: 48,
  },
  xxxx: {
    use: 'number', // 示例：使用字典中key=='number'这条规则的参数
    label: 'xxx', // 有需要替换属性的再覆盖
  },
  size: {
    use: 'number',
    min: 0,
    label: $demoi18n('word.size'),
  },
  count: {
    label: $demoi18n('form-item-config-base.count'),
    type: 'number',
    min: 0,
    step: 1,
    default: 0,
  },
};
